<template>
  <div>
    <h3>子组件</h3>
    <p>{{ a }}</p>
    <p>{{ b }}</p>
    <button @click="hClick">点击事件</button>
  </div>
</template>

<script>
export default {
  props: {
    // value: {
    //   type: Number,
    //   required: true
    // }
    a: {
      required: true,
      type: Number
    },
    b: {
      required: true,
      type: Number
    }
  },
  data() {
    return {
      num1: 6
    }
  },
  methods: {
    hClick() {
      this.$emit('update:a', 'a')
      this.$emit('update:b', 'b')
    }
  }
}
</script>

<style>

</style>
